@extends('admin.pop_show')
@section('body')
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body">
                <div class="layui-tab">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基础信息</li>
                        <li>变更记录</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <x-detail.title>
                                <x-detail.desc label="预约号">{{$entity['id']}}</x-detail.desc>
                                <x-detail.desc label="姓名">{{$entity['name']}}</x-detail.desc>
                                <x-detail.desc label="联系电话">{{$entity['mobile']}}</x-detail.desc>
                                <x-detail.desc label="真是姓名">{{$entity['real_name']}}</x-detail.desc>

                                <x-detail.desc label="咨询状态">{{$entity['consultation_type_text']}}</x-detail.desc>
                                <x-detail.desc label="年龄">{{$entity['age']}}</x-detail.desc>
                                <x-detail.desc label="性别">{{$entity['gender_text']}}</x-detail.desc>
                                <x-detail.desc label="微信码">{{$entity['weixin']}}</x-detail.desc>

                                <x-detail.desc label="预约时间">{{$entity['yy_time']}}</x-detail.desc>
                                <x-detail.desc label="来源媒体">{{$entity['source_name']}}</x-detail.desc>

                                <x-detail.desc label="话务员">{{$entity['medical_name']}}</x-detail.desc>
                                <x-detail.desc label="医生">{{$entity['yy_doctor_name']}}</x-detail.desc>
                                <x-detail.desc label="咨询客服">{{$entity['custom_service_name']}}</x-detail.desc>

                                <x-detail.desc label="费用">{{$entity['cost_money']}}</x-detail.desc>
                                <x-detail.desc label="状态">{{$entity['status_text']}}</x-detail.desc>

                            </x-detail.title>
                            <x-detail.title title="地址信息">
                                <x-detail.desc label="所属省份">{{$entity['province_name']}}</x-detail.desc>
                                <x-detail.desc label="所在市区">{{$entity['city_name']}}</x-detail.desc>
                            </x-detail.title>

                            <x-detail.title title="来源信息">
                                <x-detail.desc label="来源网站">{{$entity['source_site']}}</x-detail.desc>
                                <x-detail.desc label="IP地址">{{$entity['source_ip']}}</x-detail.desc>
                                <x-detail.desc label="成永久身份ID">{{$entity['source_consulting_page']}}</x-detail.desc>
                                <x-detail.desc label="搜索关键词">{{$entity['source_search_keywords']}}</x-detail.desc>
                                <x-detail.desc label="购买词">{{$entity['gm_words']}}</x-detail.desc>
                            </x-detail.title>
                            <x-detail.title title="病情描述">
                                <x-detail.desc colspan="4">{{$entity['disease_desc']}}</x-detail.desc>
                            </x-detail.title>
                            <x-detail.title title="商务通记录">
                                <x-detail.desc colspan="4">{!! $entity['swt'] !!}</x-detail.desc>
                            </x-detail.title>
                        </div>
                        <div class="layui-tab-item">
                            <ul class="layui-timeline">
                                @foreach($logs as $log)
                                    <li class="layui-timeline-item">
                                        <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                                        <div class="layui-timeline-content layui-text">
                                            <div class="layui-timeline-title">{{$log['created_at']}}
                                                【{{$log['type_text']}}】({{$log['name']}})
                                            </div>
                                            <div>
                                                <table class="layui-table">
                                                    <colgroup>
                                                        <col width="150">
                                                        <col width="200">
                                                        <col>
                                                    </colgroup>
                                                    <thead>
                                                    <tr>
                                                        <th>字段</th>
                                                        <th>变更前值</th>
                                                        <th>变更后值</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    @foreach($log['change_data'] as $cd)
                                                        <tr>
                                                            <td>{{$cd['field_name']}}</td>
                                                            <td>{{$cd['old_value_text']}}</td>
                                                            <td>{{$cd['new_value_text']}}</td>
                                                        </tr>
                                                    @endforeach
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
@stop
@push('script')
    <script>
        //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function () {
            var element = layui.element;

            //…
        });
    </script>
@endpush